package com.sc.nft.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.google.common.collect.Lists;
import com.sc.nft.entity.vo.mall.RefundReasonVO;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.ArrayList;
import java.util.List;

@AllArgsConstructor
@Getter
public enum RefundReasonEnum {


    DESCRIPTION_DOES_NOT_MATCH(1,"参数等与描述不符"),
    WRONG_SHOT(2,"拍错/多拍/不喜欢"),
    NEGOTIATE_WITH_THE_MERCHANT_FOR_A_REFUND(3,"与商家协商一致退款"),
    QUALITY_ISSUES(4,"质量问题"),
    OMISSION(5,"少件/漏发"),
    PRODUCT_DAMAGE(6,"包装/商品破损/污渍"),
    LATE_DELIVERY(7,"未按约定时间发货"),
    THE_MERCHANT_SENT_THE_WRONG_PRODUCT(8,"商家发错货"),
    SEVEN_DAYS_NO_REASON_TO_REFUND(9,"7天无理由退款"),
    SYSTEM_SIGN_FOR_GOODS_NOT_RECEIVED(10,"系统签收商品未收到"),
    EXPRESS_INFORMATION_HAS_NOT_BEEN_UPDATED_FOR_A_LONG_TIME(11,"快递信息长时间未更新"),

            ;
    @EnumValue
    private int code;
    private String description;


    public static List<RefundReasonVO> getRefundReasonList(){
        ArrayList<RefundReasonVO> list = Lists.newArrayList();
        RefundReasonEnum[] values = values();
        for (RefundReasonEnum value : values) {
            RefundReasonVO refundReasonVO = new RefundReasonVO();
            refundReasonVO.setType(value.toString());
            refundReasonVO.setTypeName(value.getDescription());
            list.add(refundReasonVO);
        }
        return list;
    }

    public static void main(String[] args) {
        List<RefundReasonVO> refundReasonList = getRefundReasonList();
        System.out.println(refundReasonList);
    }


}
